package com.global.college.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gyf.barlibrary.ImmersionBar;
import com.global.college.MainActivity;
import com.global.college.R;
import com.global.college.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 支付成功
 */
public class PaySuccessActivity extends BaseActivity {


    @BindView(R.id.ll_return)
    LinearLayout llReturn;
    @BindView(R.id.tv_pay_status)
    TextView tvPayStatus;
    @BindView(R.id.tv_pay_tip)
    TextView tvPayTip;
    @BindView(R.id.ll_return_home)
    LinearLayout llReturnHome;
    @BindView(R.id.ll_start_study)
    LinearLayout llStartStudy;
    @BindView(R.id.tv_server_tip)
    TextView tvServerTip;
    private String trainId;

    @Override
    public int getContentViewId() {
        return R.layout.activity_pay_success;
    }

    @Override
    public void onCreateNew(Bundle savedInstanceState) {
        setShowTitleBar(false);
        ImmersionBar.with(this)
                .statusBarColor(R.color.color_ED1428)
                .statusBarDarkFont(false)
                .init();
    }

    @Override
    public void getInitData() {
        trainId = getIntent().getStringExtra("trainId");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.ll_return, R.id.ll_return_home, R.id.ll_start_study})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_return:
                finish();
                break;
            case R.id.ll_return_home:
                JugeAndOpenActivity(MainActivity.class);
                break;
            case R.id.ll_start_study:
                startActivity(new Intent(PaySuccessActivity.this, TrainDetailBoughtActivity.class)
                        .putExtra("trainId",trainId));
                finish();
                break;
        }
    }
}